package com.cdfahe.common.util;

import org.springframework.context.support.ResourceBundleMessageSource;

/**
 * ResourceBundleMessageSourceExtend
 * 
 * @author liu_dawei
 * 
 */
public class ResourceBundleMessageSourceExtend extends ResourceBundleMessageSource {

    private String[] extendBaseNames;

    /**
     * 
     * <p>
     * setBasenames
     * </p>
     * 
     * @param basenames
     * @see org.springframework.context.support.ResourceBundleMessageSource#setBasenames(java.lang.String[])
     */
    @Override
    public void setBasenames(String[] basenames) {
        // TODO Auto-generated method stub
        String tempBaseName = basenames[0].toString();
        int length = tempBaseName.split(",").length;
        extendBaseNames = new String[length];

        for (int i = 0; i < length; i++) {
            extendBaseNames[i] = tempBaseName.split(",")[i];
        }

        super.setBasenames(extendBaseNames);
    }

}

